package com.xneure.ilog.views;

import org.eclipse.swt.SWT;

public enum LogLevel{
	INFO{
		@Override
		public int color(){
			return SWT.COLOR_BLACK;
		}
	},
	WARN{
		@Override
		public int color(){
			return SWT.COLOR_MAGENTA;
		}
	},
	DEBUG{
		@Override
		public int color(){
			return SWT.COLOR_BLUE;
		}
	},
	ERROR{
		@Override
		public int color(){
			return SWT.COLOR_RED;
		}
	};
	public abstract int color();

	public static LogLevel getLevel(String level){
		for(LogLevel ll:values()){
			if(level.contains(ll.name())){
				return ll;
			}
		}
		return null;
	}
}
